﻿<%@ Page Title="" Language="C#" MasterPageFile="~/DCTEDU_/HeThongMaster.master" AutoEventWireup="true"
    CodeBehind="Tong-Hop-Bao-Cao.aspx.cs" Inherits="QuanLyThietBi.DCTEDU_.BaoCao.Tong_Hop_Bao_Cao" %>
<%@ Register TagPrefix="cc1" Namespace="SiteUtils" Assembly="CollectionPager" %>     
<%@ Register Assembly="PagerControl" Namespace="CutePager" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>Tổng hợp Báo cáo</title>    
    <script type="text/javascript">
        function PrintDiv() {
            var contents = document.getElementById("getPrint").innerHTML;
            var frame1 = document.createElement('iframe');
            frame1.name = "frame1";
            frame1.style.border = "1";
            frame1.style.width = "1px";
            frame1.style.position = "absolute";
            frame1.style.top = "-1000000px";
            document.body.appendChild(frame1);
            var frameDoc = frame1.contentWindow ? frame1.contentWindow : frame1.contentDocument.document ? frame1.contentDocument.document : frame1.contentDocument;
            frameDoc.document.open();
            frameDoc.document.write('<html><head><title>Báo cáo Tình trạng trang thiết bị</title>');
            frameDoc.document.write('</head><body>');
            frameDoc.document.write(contents);
            frameDoc.document.write('</body></html>');
            frameDoc.document.close();
            setTimeout(function () {
                window.frames["frame1"].focus();
                window.frames["frame1"].print();
                document.body.removeChild(frame1);
            }, 500);
            return false;
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">  
<asp:UpdatePanel runat="server" ID="upPanel1"><ContentTemplate>
    <div class="row">
        <div class="col-lg-12">
            <!--tab nav start-->
            <section class="panel">
                <header class="panel-heading tab-bg-dark-navy-blue ">
                    <ul class="nav nav-tabs">
                        <li class="active">
                            <a data-toggle="tab" href="#hoatdong">Hoạt động sửa chữa</a>
                        </li>
                        <li class="">
                            <a data-toggle="tab" href="#ungdung">Phần mềm ứng dụng</a>
                        </li>
                    </ul>
                </header>
                <div class="panel-body">
                    <div class="tab-content">
                        <div id="hoatdong" class="tab-pane active">
                            <div class="row">
            <div class="col-sm-12">
                <section class="panel">
                    <header class="panel-heading">
                        Báo cáo hoạt động sửa chữa
                        <span class="tools pull-right">
                            <a href="javascript:;" class="fa fa-chevron-down"></a>
                         </span>
                    </header>
                    <div class="panel-body" id="getPrint">
  
                  <div id="hidden-table-info_wrapper" class="dataTables_wrapper form-inline" role="grid">
                     <table cellpadding="0" cellspacing="0" border="0" class="display table table-bordered " id="hidden-table-info" aria-describedby="hidden-table-info_info">
                    <thead>
                    <tr role="row">
                        <th style="width: 21px;" aria-label=""></th>
                        <th class="sorting_asc" role="columnheader" tabindex="0" aria-controls="hidden-table-info" rowspan="1" colspan="1" style="width: 125px;" aria-sort="ascending" aria-label="Rendering engine: activate to sort column descending">Phòng máy tính</th>  
                        <th class="sorting" role="columnheader" tabindex="0" aria-controls="hidden-table-info" rowspan="1" colspan="1" style="width: 149px; display: none;" aria-label="Browser: activate to sort column ascending"></th>
                        <th class="sorting" role="columnheader" tabindex="0" aria-controls="hidden-table-info" rowspan="1" colspan="1" style="width: 149px;" aria-label="Browser: activate to sort column ascending">Cán bộ quản lý</th>
                        <th class="hidden-phone sorting" role="columnheader" tabindex="0" aria-controls="hidden-table-info" rowspan="1" colspan="1" style="width: 37px;" aria-label="Engine version: activate to sort column ascending">Số thiết bị</th>
                        <th class="hidden-phone sorting" role="columnheader" tabindex="0" aria-controls="hidden-table-info" rowspan="1" colspan="1" style="width: 89px;" aria-label="CSS grade: activate to sort column ascending">Số lần đã sửa chữa</th> 
                        <th class="hidden-phone sorting" role="columnheader" tabindex="0" aria-controls="hidden-table-info" rowspan="1" colspan="1" style="width: 89px;" aria-label="CSS grade: activate to sort column ascending">Số lần chờ sửa chữa</th>    
                        <th class="hidden-phone sorting" role="columnheader" tabindex="0" aria-controls="hidden-table-info" rowspan="1" colspan="1" style="width: 89px;" aria-label="CSS grade: activate to sort column ascending">Đánh giá</th>
                    </tr>
                    </thead>
                    <tbody role="alert" aria-live="polite" aria-relevant="all">    
                    <asp:Repeater runat="server" ID="rpPhongMay" OnItemDataBound="rpPhongMay_OnItemDataBound"><ItemTemplate>
                    <tr class="gradeA odd">
                        <td class="center  ">    
                        <asp:Image runat="server" ID="imgopen" ImageUrl="~/Images/details_open.png"/>
                        </td>     
                        <asp:HiddenField runat="server" ID="H_MaPhong" Value='<%# Eval("MaPhong") %>'/>
                        <td class=" sorting_1 "><%# Eval("TenPhong") %></td>    
                        <td style=" display: none;" class="">  
                        <div class="col-md-3">
        <section class="panel">
            <div class="panel-body">
                <div class="top-stats-panel">
                    <h4 class="widget-h">Thống kê thiết bị</h4>
                    <div class="bar-stats">
                        <ul class="progress-stat-bar clearfix">     
                            <li data-percent='<%# getPhanTramChoSuaChua(Eval("MaPhong"))+"%" %>'><span class="progress-stat-percent" style='<%# "height: "+ getPhanTramChoSuaChua(Eval("MaPhong"))+"%;" %>'></span></li>
                            <li data-percent='<%# getPhanTramDaSuaChua(Eval("MaPhong"))+"%" %>'><span class="progress-stat-percent yellow-b" style='<%# "height: "+ getPhanTramDaSuaChua(Eval("MaPhong"))+"%;" %>'></span></li>
                        </ul>                                        
                        <ul class="bar-legend">
                            <li><span class="bar-legend-pointer green"></span> Chờ sửa chữa</li>
                            <li><span class="bar-legend-pointer yellow-b"></span> Đã sửa chữa</li>
                        </ul>
                        <div class="daily-sales-info">
                            <span class="sales-count"><%# getSoThietBiBaoCao(Eval("MaPhong"))%> </span> <span class="sales-label">thiết bị được báo cáo</span>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </div>  
    <div class="col-md-9">
                            <table class="table table-bordered table-striped table-condensed">
                                <thead>
                                <tr>
                                    <th>Tên thiết bị</th> 
                                    <th>Ngày báo cáo</th>
                                    <th>Ngày sửa chữa</th>     
                                    <th>Ghi chú</th>
                                    <th>Hướng giải quyết</th>
                                    <th>Số lần sửa chữa</th>
                                    <th>Cán bộ báo cáo</th>
                                </tr>
                                </thead>
                                <tbody>
                                <asp:Repeater runat="server" ID="rpThietBi"><ItemTemplate>
                                <tr>
                                    <td><%# getTenThietBi(Eval("MaThietBi")) %></td>
                                    <td><%# Convert.ToDateTime(Eval("NgayCapNhat")).ToString("dd/MM/yyyy") %></td>
                                    <td align="center"><%# getNgaySuaChua(Eval("MaHoatDongSuaChua")) %></td>
                                    <td><%# Eval("GhiChu") %></td>
                                    <td><%# getHuongGiaiQuyet(Eval("MaHoatDongSuaChua")) %></td>  
                                    <td align="center"><%# getSoLanSuaChuaThietBi(Eval("MaThietBi")) %></td>
                                    <td><%# getTenCanBo(Eval("MaCanBo")) %></td>
                                </tr>    
                                </ItemTemplate></asp:Repeater>   
                                <%-- <cc1:Pager ID="Pager1" runat="server" PreviousClause="Lùi" NextClause="Tiến" LastClause=""
                                    FirstClause="" PageClause="Trang " OfClause=" /" PageSize="5" OnCommand="Pager1_Command"
                                    ForeColor="#006600" Font-Bold="True" />--%>
                                <cc1:CollectionPager ID="pager" runat="server" PageSize="5" ></cc1:CollectionPager> 
                                </tbody>
                            </table>  
                            </div>
                            </td>
                        <td class=" "><%# getTenCanBo(Eval("MaCanBo")) %></td>
                        <td class="hidden-phone  "><%# getSoThietBi(Eval("MaPhong")) %></td>
                        <td class="center hidden-phone  "><%# getSoLanSuaChua(Eval("MaPhong")) %></td>  
                        <td class="center hidden-phone  " style='<%# Convert.ToInt32(getSoLanChoSuaChua(Eval("MaPhong"))) > 9 ? "color: red; font-weight: bold;" : "" %>' align="center"><%# getSoLanChoSuaChua(Eval("MaPhong")) %></td>
                        <td class="center hidden-phone  "><%# getDanhGiaSuaChua(Eval("MaPhong")) %></td> 
                    </tr>  
                      </ItemTemplate>
                      </asp:Repeater>
                  
                    </tbody></table>
                  </div>
                    </div> 
                   
                </section>
            </div>   
        </div>   
             <asp:Button ID="cmdPrint" runat="server" CausesValidation="false" OnClick="cmdPrint_OnClick" Text="In báo cáo" CssClass="btn btn-primary btn-image-print" />

                        </div>
                        <div id="ungdung" class="tab-pane">
             <div class="row">
            <div class="col-sm-12">
                <section class="panel">
                    <header class="panel-heading">
                        Báo cáo Phần mềm ứng dụng
                        <span class="tools pull-right">
                            <a href="javascript:;" class="fa fa-chevron-down"></a>
                         </span>
                    </header>
                    <div class="panel-body" id="Div1">
  
                  <div id="Div2" class="dataTables_wrapper form-inline" role="grid">
                     <table cellpadding="0" cellspacing="0" border="0" class="display table table-bordered " id="hidden-table-info" aria-describedby="hidden-table-info_info">
                    <thead>
                    <tr role="row">
                        <th class="sorting_asc" role="columnheader" tabindex="0" aria-controls="hidden-table-info" rowspan="1" colspan="1" style="width: 125px;" aria-sort="ascending" aria-label="Rendering engine: activate to sort column descending">Phòng máy tính</th>  
                        <th class="sorting" role="columnheader" tabindex="0" aria-controls="hidden-table-info" rowspan="1" colspan="1" style="width: 149px;" aria-label="Browser: activate to sort column ascending">Cán bộ quản lý</th>
                        <th class="hidden-phone sorting" role="columnheader" tabindex="0" aria-controls="hidden-table-info" rowspan="1" colspan="1" style="width: 37px;" aria-label="Engine version: activate to sort column ascending">Số phần mềm</th>
                        <th class="hidden-phone sorting" role="columnheader" tabindex="0" aria-controls="hidden-table-info" rowspan="1" colspan="1" style="width: 89px;" aria-label="CSS grade: activate to sort column ascending">Đánh giá</th>
                    </tr>
                    </thead>
                    <tbody role="alert" aria-live="polite" aria-relevant="all">    
                    <asp:Repeater runat="server" ID="rpPhongMayPhanMem"><ItemTemplate>
                    <tr class="gradeA odd">   
                        <asp:HiddenField runat="server" ID="H_MaPhong" Value='<%# Eval("MaPhong") %>'/>
                        <td class=" sorting_1 "><%# Eval("TenPhong") %></td>    
                        <td class=" "><%# getTenCanBo(Eval("MaCanBo")) %></td>
                        <td class="hidden-phone  "><%# getSoPhanMem(Eval("MaPhong")) %></td>
                        <td class="center hidden-phone  "><%# getDanhGiaPhanMem(Eval("MaPhong")) %></td> 
                    </tr>  
                      </ItemTemplate>
                      </asp:Repeater>
                  
                    </tbody></table>
                  </div>
                    </div> 
                   
                </section>
            </div>   
        </div>                  
                        </div>

                    </div>
                </div>
            </section>
            <!--tab nav start-->
        </div>
    </div>     
   
    </ContentTemplate></asp:UpdatePanel>    
    <asp:UpdateProgress runat="server" ID="UpdateProgress2" AssociatedUpdatePanelID="upPanel1">
        <ProgressTemplate>
            <div style="top: 20%; right: 50%; transition: all 300ms ease 100ms; color: Black;
                padding: 8px; position: fixed; z-index: 10000">
                <asp:Image runat="server" ID="imgloading" ImageUrl="~/Images/loading.gif" /></div>
        </ProgressTemplate>
    </asp:UpdateProgress>
</asp:Content>
